#define _CRT_SECURE_NO_WARNINGS 1
class Solution {
public:
    int findMinArrowShots(vector<vector<int>>& points) {
        sort(points.begin(), points.end());
        int right = points[0][1], ret = 1;
        for (int i = 1; i < points.size(); i++)
        {
            if (right >= points[i][0]) right = min(right, points[i][1]);
            else ret++, right = points[i][1];
        }
        return ret;
    }
};